package com.lh.nk;

import java.math.BigInteger;

/**
 * @author: linghao
 * @since: 2023/1/19
 * 描述
 * 以字符串的形式读入两个数字，编写一个函数计算它们的和，以字符串形式返回。
 *
 * 数据范围：
 * s.length,t.length≤100000，字符串仅由'0'~‘9’构成
 */
public class 大数加法NC1 {

    public static void main(String[] args) {
        System.out.println(solve("99999999999999999999999999999999999999999999999999999999999994", "99999999999999999999999999999999999999999999999999999999999994"));
    }


    public static String solve (String s, String t) {
        // write code here
        if("".equals(s)){
            s = "0";
        }
        if("".equals(t)){
            t = "0";
        }
        BigInteger bis = new BigInteger(s);
        BigInteger bit = new BigInteger(t);
        return String.valueOf( bis.add(bit).toString());
    }
}
